/**
 * @Author: 焦质晔
 * @Date: 2019/6/20
 * @Last Modified by: mikey.zhaopeng
 * @Last Modified time: 2019-12-12 15:48:30
 */
const RouteView = () => import('@/layout/RouteView');
// 异步路由组件加载
const AsyncComponent = __name__ => () => import(`@/pages/${__name__}`);

// 菜单路由
const menuRoutes = [
  {
    path: '/admin',
    meta: { title: '公共参数', icon: 'el-icon-s-tools' },
    redirect: '/admin/org',
    component: RouteView,
    children: [
      {
        path: '/admin/systemParameter',
        meta: { title: '系统参数设置' },
        redirect: '/admin/systemParameter/settleStyle',
        component: RouteView,
        children: [
          {
            path: '/admin/systemParameter/settleStyle',
            meta: { title: '结算方式管理', keepAlive: true },
            component: AsyncComponent('common/systemParameter/settleStyle/index')
          }
        ]
      },
      //厂端
      {
        path: '/admin/systemParameter/gms',
        meta: { title: '系统参数设置' },
        redirect: '/admin/systemParameter/gms/settleStyle',
        component: RouteView,
        children: [
          {
            path: '/admin/systemParameter/gms/settleStyle',
            meta: { title: '结算方式管理', keepAlive: true },
            component: AsyncComponent('common/systemParameter/gms/settleStyle/index')
          }
        ]
      },
      {
        path: '/admin/org',
        meta: { title: '组织机构' },
        redirect: '/admin/org/dealerCompany',
        component: RouteView,
        children: [
          {
            path: '/admin/org/dealerCompany',
            meta: { title: '经销商基本信息', keepAlive: true },
            component: AsyncComponent('common/org/dealerCompany/index')
          },
          {
            path: '/admin/org/companyOrgManage',
            meta: { title: '部门管理', keepAlive: true },
            component: AsyncComponent('common/org/companyOrgManage/index')
          },
          {
            path: '/admin/org/employeeInfo',
            meta: { title: '员工信息管理', keepAlive: true },
            component: AsyncComponent('common/org/employeeInfo/index')
          }
        ]
      },
      //厂端
      {
        path: '/admin/org/gms',
        meta: { title: '组织机构' },
        redirect: '/admin/org/gms/saleCompanyMaintain',
        component: RouteView,
        children: [
          {
            path: '/admin/org/gms/saleCompanyMaintain',
            meta: { title: '销售公司维护', keepAlive: true },
            component: AsyncComponent('common/org/gms/saleCompanyMaintain/index')
          },
          {
            path: '/admin/org/gms/companyOrgMaintain',
            meta: { title: '部门维护', keepAlive: true },
            component: AsyncComponent('common/org/gms/companyOrgMaintain/index')
          },
          {
            path: '/admin/org/gms/dealerCompany',
            meta: { title: '经销商公司维护', keepAlive: true },
            component: AsyncComponent('common/org/gms/dealerCompany/index')
          }
        ]
      },
      {
        path: '/admin/auth',
        meta: { title: '权限管理' },
        redirect: '/admin/auth/roleManage',
        component: RouteView,
        children: [
          {
            path: '/admin/auth/roleManage',
            meta: { title: '角色权限管理', keepAlive: true },
            component: AsyncComponent('common/auth/roleManage/index')
          },
          {
            path: '/admin/auth/oemRoleManage',
            meta: { title: '经销商角色权限配置', keepAlive: true },
            component: AsyncComponent('common/auth/oemRoleManage/index')
          },
          {
            path: '/admin/auth/positionAuth',
            meta: { title: '职位权限管理', keepAlive: true },
            component: AsyncComponent('common/auth/positionAuth/index')
          },
          {
            path: '/admin/auth/searchEmployeePermissionInfo',
            meta: { title: '员工管理', keepAlive: true },
            component: AsyncComponent('common/auth/employeeAuth/index')
          },
          {
            path: '/admin/auth/userInfo',
            meta: { title: '我的资料', keepAlive: true },
            component: AsyncComponent('common/auth/userInfo/index')
          },
          {
            path: '/admin/auth/oem/DealerStaff',
            meta: { title: '关键岗位员工信息查看', keepAlive: true },
            component: AsyncComponent('common/auth/oem/DealerStaff/index')
          },
          {
            path: '/admin/auth/oem/downloadCenter',
            meta: { title: '下载中心', keepAlive: true },
            component: AsyncComponent('common/auth/oem/downloadCenter')
          }
        ]
      },
      {
        path: '/admin/version',
        meta: { title: '版本管理' },
        redirect: '/admin/version/versionManage',
        component: RouteView,
        children: [
          {
            path: '/admin/version/versionManage',
            meta: { title: 'APP版本管理', keepAlive: true },
            component: AsyncComponent('common/version/versionManage/index')
          }
        ]
      },
      {
        path: '/admin/cars',
        meta: { title: '整车主数据' },
        redirect: '/admin/cars/brandcarsmodels',
        component: RouteView,
        children: [
          {
            path: '/admin/cars/brandcarsmodels',
            meta: { title: '品牌车系车型', keepAlive: true },
            component: AsyncComponent('common/cars/brandcarsModels/index')
          },
          {
            path: '/admin/cars/colorcars',
            meta: { title: '车辆颜色', keepAlive: true },
            component: AsyncComponent('common/cars/colorCars/index')
          },
          {
            path: '/admin/cars/masterdatacars',
            meta: { title: '车辆主数据', keepAlive: true },
            component: AsyncComponent('common/cars/masterDataCars/index')
          },
          {
            path: '/admin/cars/vehicleClassification',
            meta: { title: '整车分类定义', keepAlive: true },
            component: AsyncComponent('common/cars/vehicleClassification/index')
          }
        ]
      },
      {
        path: '/admin/notice',
        meta: { title: '通知管理' },
        redirect: '/admin/notice/noticerule',
        component: RouteView,
        children: [
          {
            path: '/admin/notice/noticerule',
            meta: { title: '通知规则设置', keepAlive: true },
            component: AsyncComponent('common/notice/noticerule/index')
          },
          {
            path: '/admin/notice/noticemanage',
            meta: { title: '通知公告查看', keepAlive: true },
            component: AsyncComponent('common/notice/noticemanage/index')
          },
          {
            path: '/admin/notice/maintain',
            meta: { title: '公告维护', keepAlive: true },
            component: AsyncComponent('common/notice/maintain/index')
          },
          {
            path: '/admin/notice/dcsNoticeMaintain',
            meta: { title: '公告维护', keepAlive: true },
            component: AsyncComponent('admin/notice/dcsNoticeMaintain/index')
          },
          {
            path: '/admin/notice/dcsNotice',
            meta: { title: '通知通告查看', keepAlive: true },
            // component: AsyncComponent('common/notice/noticemanage/index')
            component: AsyncComponent('admin/notice/dcsNotice/index')
          } /* 本地已有,
           {
            path: '/admin/notice/dcsNoticeStat',
            meta: { title: '通知通告统计', keepAlive: true },
            component: AsyncComponent('admin/notice/dcsNoticeStat/index')
           } */
        ]
      },
      {
        path: '/admin/partAndTool',
        meta: { title: '配件及工具' },
        redirect: '/admin/partAndTool',
        component: RouteView,
        children: [
          {
            path: '/admin/partAndTool/warehouseDefinition',
            meta: { title: '仓库定义', keepAlive: true },
            component: AsyncComponent('common/partAndTool/warehouseDefinition/index')
          }
        ]
      },
      {
        path: '/admin/logManage',
        meta: { title: '日志管理' },
        redirect: '/admin/logManage',
        component: RouteView,
        children: [
          {
            path: '/admin/logManage/operateLog',
            meta: { title: '系统操作日志', keepAlive: true },
            component: AsyncComponent('admin/logManage/operateLog/index')
          }
        ]
      },
      {
        path: '/admin/CompanySale',
        meta: { title: '经销商信息管理' },
        redirect: '/admin/CompanySale',
        component: RouteView,
        children: [
          {
            path: '/admin/CompanySale/dealerInfoMaintenance',
            meta: { title: '销售信息维护', keepAlive: true },
            component: AsyncComponent('common/CompanySale/dealerInfoMaintenance/index')
          }
        ]
      },
      {
        path: '/admin/CompanyRepair',
        meta: { title: '经销商售后管理' },
        redirect: '/admin/CompanyRepair',
        component: RouteView,
        children: [
          {
            path: '/admin/CompanyRepair/saleInfoMaintenance',
            meta: { title: '售后信息维护', keepAlive: true },
            component: AsyncComponent('common/CompanyRepair/saleInfoMaintenance/index')
          }
        ]
      }
    ]
  }
];

export default menuRoutes;
